import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { EmgResourceDetailVO, EmgResourceDetailForm, EmgResourceDetailQuery } from '@/api/biz/emgResourceDetail/types';

/**
 * 查询应急资源详情列表
 * @param query
 * @returns {*}
 */

export const listEmgResourceDetail = (query?: EmgResourceDetailQuery): AxiosPromise<EmgResourceDetailVO[]> => {
  return request({
    url: '/biz/emgResourceDetail/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询应急资源详情详细
 * @param id
 */
export const getEmgResourceDetail = (id: string | number): AxiosPromise<EmgResourceDetailVO> => {
  return request({
    url: '/biz/emgResourceDetail/' + id,
    method: 'get'
  });
};

/**
 * 新增应急资源详情
 * @param data
 */
export const addEmgResourceDetail = (data: EmgResourceDetailForm) => {
  return request({
    url: '/biz/emgResourceDetail',
    method: 'post',
    data: data
  });
};

/**
 * 修改应急资源详情
 * @param data
 */
export const updateEmgResourceDetail = (data: EmgResourceDetailForm) => {
  return request({
    url: '/biz/emgResourceDetail',
    method: 'put',
    data: data
  });
};

/**
 * 删除应急资源详情
 * @param id
 */
export const delEmgResourceDetail = (id: string | number | Array<string | number>) => {
  return request({
    url: '/biz/emgResourceDetail/' + id,
    method: 'delete'
  });
};
